package com.networknt.config;

import java.util.Map;

public class ConfigNoCache {

	@SuppressWarnings("unchecked")
	public static <T> T getJsonObjectConfig(String configName, Class<T> clazz) {
		Map<String, Object> values = Config.getInstance()
				.getJsonMapConfigNoCache(ConfigInjection.CENTRALIZED_MANAGEMENT);
		Config.getInstance().putInConfigCache(ConfigInjection.CENTRALIZED_MANAGEMENT, values);
		Map<String, Object> configMap = Config.getInstance().getJsonMapConfigNoCache(configName);
		return configMap == null ? null : (T) CentralizedManagement.mergeObject(configMap, clazz);
	}
	
}
